package com.cgq.pro.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.cgq.pro.entity.User;
import com.cgq.pro.service.LoginService;
import com.opensymphony.xwork2.ActionSupport;

@Controller
public class LoginAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private LoginService loginService;
	
	private User model;
	
	public User getModel() {
		return model;
	}

	public void setModel(User model) {
		this.model = model;
	}

	/**
	 * 判断用户是否存在
	 * @param user
	 * @return
	 */
	public String login(){
		if(loginService.isExitUser(model)){
			return "mainUI";
		}
		return "failUI";
	}
	
}
